﻿using System.Windows;

namespace AiMoWindows.Windows.AiAssistant.ViewModels
{
    class AiAssistantUIViewModel : UIViewModelBase
    {
        string askAiButtonText = "";
        public string AskAiButtonText => askAiButtonText;
        public string AskCancelButtonText => IsEnglish ? "Cancel" : "取消";
        bool _AskCancelButtonEnable = false;

        public string ClearOutputMenuText => IsEnglish ? "Clear Ai Output" : "清空 AI 输出";
        public string SendCodeMenuText => IsEnglish ? "Send Ai code to \"C# Editor\"" : "发送Ai代码到“C# 编辑器”";
        public AiAssistantUIViewModel(Window owner) : base(owner)
        {
            TitlePrefix = "AiMo Ai";
            ChangeAskAiButtonMode(AskAiButtonMode.CanAsk);
        }
        public void ChangeAskAiButtonMode(AskAiButtonMode mode)
        {
            switch (mode)
            {
                default:
                case AskAiButtonMode.CanAsk:
                    askAiButtonText = IsEnglish ? "Ask Ai" : "询问AI";
                    break;
                case AskAiButtonMode.Connecting:
                    askAiButtonText = IsEnglish ? "Connecting" : "正在连接";
                    break;
                case AskAiButtonMode.Waiting:
                    askAiButtonText = IsEnglish ? "Wait in line" : "排队中";
                    break;
                case AskAiButtonMode.Replying:
                    askAiButtonText = IsEnglish ? "Replying" : "回答中";
                    break;
            }
            RaisePropertyChanged(nameof(AskAiButtonText));
        }

        public bool AskCancelButtonEnable
        {
            get => _AskCancelButtonEnable;
            set
            {
                _AskCancelButtonEnable = value;
                RaisePropertyChanged(nameof(AskCancelButtonEnable));
            }
        }
    }
}
